package com.study.spark.scala.chapter02

import java.io.ObjectInputStream
import java.net.ServerSocket


object Scala06_Slaver_Object {

  def main(args: Array[String]): Unit = {
    // TODO 服务端
    val server = new ServerSocket(9999)
    println("服务器已经启动，等待客户端连接...")
    val client = server.accept()
    val in = new ObjectInputStream(client.getInputStream)


    val user = in.readObject()

    println("从客户端接收的数据是："+user)

    in.close()

    client.close()
    server.close()

  }
}
